<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>vue 09</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
    <div id="app">{{msg}}
        <ul>
            <li v-for="item,index in items">{{index}} {{item}}</li>
            <li v-for="(item, index) in obj" :key="index">{{index}} {{item}}</li>
        </ul>
    </div>
    <script text="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                msg: "I am coming!",
                items: ["a", "b", "c", "d"],
                obj: {
                    name: "cafebabe",
                    title: "foobar",
                    author: "ccd",
                    date: "2021年5月25日",
                }
            }
        });

        setTimeout(() => {
            app.obj = {
                date: "rq",
                title: "foobar2",
                name: "NB",
            }
        }, 2000);
    </script>
</body>